<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/business/include/doctype.jsp" %>
<script type="text/javascript">
	// 탭 변경 이벤트
	function changeTab(tp) {
		if (tp == '1') {
			$('.common_tab').show();
			$('.emp_tab').hide();
			$('#tb1').attr('src', '${requestScope.contextPath}/images/main/tab1_over.gif');
			$('#tb2').attr('src', '${requestScope.contextPath}/images/main/tab/${sessionScope.SESSION_USER_INFO.CompanyCD}.gif');
		} else {
			$('.emp_tab').show();
			$('.common_tab').hide();
			$('#tb1').attr('src', '${requestScope.contextPath}/images/main/tab1.gif');
			$('#tb2').attr('src', '${requestScope.contextPath}/images/main/tab/${sessionScope.SESSION_USER_INFO.CompanyCD}_over.gif');
		}
	}
	// IKENUC, 전자결재 업데이트 관련 임시 이벤트
	function setupCheck(appNm, fileNm, obj, fdrNm) {
		$.ajax({
			url: '${requestScope.contextPath}/business/main/appSetupCheck.do',
			type:'POST',
			data: { 'appNm': appNm },
			dataType:'json',
			success: function(json){
				if (json.cnt == 0)
					location.href = 'kolonAppCheck://<fmt:message bundle="${config}" key="app.iPhone.url" /><fmt:message bundle="${config}" key="domain.iis.url" /><fmt:message bundle="${config}" key="app.file.iPhone.path" />'+fdrNm+'/'+fileNm;
				else
					location.href = 'kolonAppCheck://'+appNm+'://?<fmt:message bundle="${config}" key="domain.iis.url" /><fmt:message bundle="${config}" key="app.file.iPhone.path" />'+fdrNm+'/'+fileNm;
			},
			error: function(){
				//alert('error');
				location.href = 'kolonAppCheck://'+appNm+'://?<fmt:message bundle="${config}" key="domain.iis.url" /><fmt:message bundle="${config}" key="app.file.iPhone.path" />'+fdrNm+'/'+fileNm;
			}
		});
	}
</script>
</head>
<body>
		<div id="wrap">
			<div <c:choose><c:when test="${platForm eq 'Android'}">class="android_main"</c:when><c:otherwise>class="main"</c:otherwise></c:choose>>
				<div class="tab3">
					<ul>
						<li><a href="#"><img src="${requestScope.contextPath}/images/main/tab1_over.gif" alt="공통" onclick="changeTab('1');" id="tb1" /></a></li>
						<li><a href="#"><img src="${requestScope.contextPath}/images/main/tab/${sessionScope.SESSION_USER_INFO.CompanyCD}.gif" alt="${sessionScope.SESSION_USER_INFO.companyname}" onclick="changeTab('2');" id="tb2" /></a></li>
					</ul>
				</div>
				<div class="icon">
					<ul class="common_tab">
					<c:forEach items="${servList}" var="servInfo" varStatus="status">
						<c:choose>
						<c:when test="${servInfo.SERV_TP eq 'B' and platForm eq 'Android'}">
							<li><a href="<fmt:message bundle="${config}" key="domain.iis.url" /><fmt:message bundle="${config}" key="app.file.Android.path" />${servInfo.FDR_NM}/${servInfo.FILE_S_NM_1}"><img src="${requestScope.contextPath}<fmt:message bundle="${config}" key="service.icon.url" />${servInfo.IMG_NM}" alt="${servInfo.SERV_NM}" width="68" height="68" /></a><span>${servInfo.SERV_NM}</span></li>
						</c:when>
						<c:when test="${servInfo.SERV_TP eq 'C' and platForm eq 'iPhone'}">
							<c:choose>
								<c:when test="${servInfo.APP_NM eq 'ikenuc' or servInfo.APP_NM eq 'msign'}">
									<c:choose>
									<c:when test="${servInfo.APP_NM eq 'ikenuc'}">
									<li><a href="javascript:setupCheck('ikenuc', '${servInfo.FILE_S_NM_1}', this, '${servInfo.FDR_NM}');"><img src="${requestScope.contextPath}<fmt:message bundle="${config}" key="service.icon.url" />${servInfo.IMG_NM}" alt="${servInfo.SERV_NM}" width="68" height="68" /></a><span>${servInfo.SERV_NM}</span></li>	
									</c:when>
									<c:otherwise>
									<li><a href="javascript:setupCheck('msign', '${servInfo.FILE_S_NM_1}', this, '${servInfo.FDR_NM}');"><img src="${requestScope.contextPath}<fmt:message bundle="${config}" key="service.icon.url" />${servInfo.IMG_NM}" alt="${servInfo.SERV_NM}" width="68" height="68" /></a><span>${servInfo.SERV_NM}</span></li>
									</c:otherwise>
									</c:choose>
								</c:when>
								<c:otherwise>
									<li><a href="kolonAppCheck://${servInfo.APP_NM}://?<fmt:message bundle="${config}" key="domain.iis.url" /><fmt:message bundle="${config}" key="app.file.iPhone.path" />${servInfo.FDR_NM}/${servInfo.FILE_S_NM_1}"><img src="${requestScope.contextPath}<fmt:message bundle="${config}" key="service.icon.url" />${servInfo.IMG_NM}" alt="${servInfo.SERV_NM}" width="68" height="68" /></a><span>${servInfo.SERV_NM}</span></li>
								</c:otherwise>
							</c:choose>
						</c:when>
						<c:when test="${servInfo.SERV_TP eq 'A'}"> 
							<c:choose>
							<c:when  test="${servInfo.SERV_NM eq '콘사이스'}">
								<c:if test="${sessionScope.SESSION_USER_INFO.conciseGrade ne ''}">
									<li><a href="${servInfo.LNK_URL}"><img src="${requestScope.contextPath}<fmt:message bundle="${config}" key="service.icon.url" />${servInfo.IMG_NM}" alt="${servInfo.SERV_NM}" width="68" height="68" /></a><span>${servInfo.SERV_NM}</span></li>
								</c:if>
							</c:when>
							<c:otherwise>
								<li><a href="${servInfo.LNK_URL}"><img src="${requestScope.contextPath}<fmt:message bundle="${config}" key="service.icon.url" />${servInfo.IMG_NM}" alt="${servInfo.SERV_NM}" width="68" height="68" /></a><span>${servInfo.SERV_NM}</span></li>
							</c:otherwise>
							</c:choose>
						</c:when>
						</c:choose>
					</c:forEach>
					</ul>
					<ul class="emp_tab" style="display: none;"></ul>
				</div>
				
				<div class="banner">
					<p>
						<a href="http://mkolonapp.kolon.com/m_list.aspx"><img src="${requestScope.contextPath}/images/main/banner.gif" alt="이런 앱 만들어주세요" /></a>
					</p>
				</div>
				 
			</div><!-- // content -->
		</div><!-- // wrap -->
</body>
</html>